From: Aaron Schulz Date: Tue, 10 May 2016 05:12:38 +0000 (-0700) Subject: Avoid master queries on GET in ProtectionForm X-Git-Tag: 1.31.0-rc.0~7034^2 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=56f8bde0fc6d3d050653980f49eed7ed7a1fa5b4;p=lhc%2Fweb%2Fwiklou.git Avoid master queries on GET in ProtectionForm Bug: T92357 Change-Id: I58c5e793164faaafeea45ec5e986edcc7537ccab --- diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 70192b9c2b..451635e319 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -70,7 +70,9 @@ class ProtectionForm { // Check if the form should be disabled. // If it is, the form will be available in read-only to show levels. $this->mPermErrors = $this->mTitle->getUserPermissionsErrors( - 'protect', $this->mContext->getUser() + 'protect', + $this->mContext->getUser(), + $this->mContext->getRequest()->wasPosted() ? 'secure' : 'full' // T92357 ); if ( wfReadOnly() ) { $this->mPermErrors[] = [ 'readonlytext', wfReadOnlyReason() ];